// 房产管理
import request from '@/utils/request'

// 数据渲染
export const getHouseInfo = params => {
  return request({
    url: '/house/index',
    method: 'get',
    params
  })
}

// 下拉框
export function communityInfo() {
  return request({
    url: '/community',
    method: 'get'
  })
}

// 根据下拉框找到对应的楼栋下拉
export const buildingHouse = id => {
  return request({
    url: `/house/building?community_code=${id}`,
    method: 'get'

  })
}

// 表格新增接口
export const addBuildingHouse = data => {
  return request({
    url: `/house/index`,
    method: 'post',
    data
  })
}

// 根据id获取详情
export const getHouseInfoByid = id => {
  return request({
    url: `/house/index/${id}`,
    method: 'get'
  })
}
// 修改
export const updateHouseInfo = data => {
  return request({
    url: `/house/index/${data.id}`,
    method: 'put',
    data
  })
}

// 删除
export const delHouseInfo = id => {
  return request({
    url: `/house/index/${id}`,
    method: 'delete'

  })
}
